#! /bin/sh
# Generated automatically by configure.
# Run this file to recreate the current configuration.
# This directory was configured as follows,
# on host Gregs-MBP2.lan:
#
# ./configure  --disable-big-core --enable-getcap --disable-database --without-default-terminfo-dir --disable-termcap --with-fallbacks=ansi --without-progs --without-debug --without-ada --without-cxx-binding --without-curses-h --without-termlib --disable-ext-funcs
#
# Compiler output produced by configure, useful for debugging
# configure, is in ./config.log if it exists.

ac_cs_usage="Usage: ./config.status [--recheck] [--version] [--help]"
for ac_option
do
  case "$ac_option" in
  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
    echo "running ${CONFIG_SHELL-/bin/sh} ./configure  --disable-big-core --enable-getcap --disable-database --without-default-terminfo-dir --disable-termcap --with-fallbacks=ansi --without-progs --without-debug --without-ada --without-cxx-binding --without-curses-h --without-termlib --disable-ext-funcs --no-create --no-recursion"
    exec ${CONFIG_SHELL-/bin/sh} ./configure  --disable-big-core --enable-getcap --disable-database --without-default-terminfo-dir --disable-termcap --with-fallbacks=ansi --without-progs --without-debug --without-ada --without-cxx-binding --without-curses-h --without-termlib --disable-ext-funcs --no-create --no-recursion ;;
  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
    echo "./config.status generated by autoconf version 2.13.20000819"
    exit 0 ;;
  -help | --help | --hel | --he | --h)
    echo "$ac_cs_usage"; exit 0 ;;
  *) echo "$ac_cs_usage"; exit 1 ;;
  esac
done

ac_given_srcdir=.
ac_given_INSTALL="/usr/bin/install -c"

trap 'rm -fr 	include/MKterm.h.awk 	include/curses.h 	include/termcap.h 	include/unctrl.h 	misc/run_tic.sh 	 man/Makefile include/Makefile ncurses/Makefile panel/Makefile menu/Makefile form/Makefile misc/Makefile test/Makefile 	Makefile include/ncurses_cfg.h conftest*; exit 1' 1 2 15

# Protect against being on the right side of a sed subst in config.status.
sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\&%]/\\&/g;
 s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF
/^[ 	]*VPATH[ 	]*=[^:]*$/d

s%@SHELL@%/bin/sh%g
s%@CFLAGS@%-O2 %g
s%@CPPFLAGS@% -DNDEBUG -I. -I../include -I$(includedir)%g
s%@CXXFLAGS@%-O2%g
s%@FFLAGS@%%g
s%@DEFS@%-DHAVE_CONFIG_H%g
s%@LDFLAGS@%%g
s%@LIBS@%%g
s%@exec_prefix@%${prefix}%g
s%@prefix@%/usr/local%g
s%@program_transform_name@%s,x,x,%g
s%@bindir@%${exec_prefix}/bin%g
s%@sbindir@%${exec_prefix}/sbin%g
s%@libexecdir@%${exec_prefix}/libexec%g
s%@datadir@%${prefix}/share%g
s%@sysconfdir@%${prefix}/etc%g
s%@sharedstatedir@%${prefix}/com%g
s%@localstatedir@%${prefix}/var%g
s%@libdir@%${exec_prefix}/lib%g
s%@includedir@%${prefix}/include%g
s%@oldincludedir@%/usr/include%g
s%@infodir@%${prefix}/info%g
s%@mandir@%${prefix}/man%g
s%@NCURSES_MAJOR@%5%g
s%@NCURSES_MINOR@%2%g
s%@NCURSES_PATCH@%20001021%g
s%@cf_cv_rel_version@%5.2%g
s%@cf_cv_abi_version@%5%g
s%@cf_cv_cc_bool_type@%0%g
s%@cf_cv_builtin_bool@%1%g
s%@cf_cv_type_of_bool@%unsigned%g
s%@host@%i386-apple-darwin18.7.0%g
s%@host_alias@%i386-apple-darwin18.7.0%g
s%@host_cpu@%i386%g
s%@host_vendor@%apple%g
s%@host_os@%darwin18.7.0%g
s%@target@%i386-apple-darwin18.7.0%g
s%@target_alias@%i386-apple-darwin18.7.0%g
s%@target_cpu@%i386%g
s%@target_vendor@%apple%g
s%@target_os@%darwin18.7.0%g
s%@build@%i386-apple-darwin18.7.0%g
s%@build_alias@%i386-apple-darwin18.7.0%g
s%@build_cpu@%i386%g
s%@build_vendor@%apple%g
s%@build_os@%darwin18.7.0%g
s%@CC@%gcc%g
s%@BUILD_CC@%gcc%g
s%@CPP@%gcc -E%g
s%@PROG_EXT@%%g
s%@LDCONFIG@%%g
s%@CXX@%c++%g
s%@AWK@%awk%g
s%@SET_MAKE@%%g
s%@INSTALL_PROGRAM@%${INSTALL}%g
s%@INSTALL_SCRIPT@%${INSTALL_PROGRAM}%g
s%@INSTALL_DATA@%${INSTALL} -m 644%g
s%@LN_S@%ln -s%g
s%@RANLIB@%ranlib%g
s%@MAKE_LOWER_TAGS@%%g
s%@MAKE_UPPER_TAGS@%#%g
s%@LINT@%%g
s%@MAN@%man%g
s%@LINT_OPTS@%%g
s%@LD@%ld%g
s%@AR@%ar%g
s%@AR_OPTS@%rv%g
s%@cf_cv_makeflags@%%g
s%@DESTDIR@%%g
s%@cf_list_models@% normal%g
s%@LIBTOOL@%%g
s%@DFT_LWR_MODEL@%normal%g
s%@DFT_UPR_MODEL@%NORMAL%g
s%@TINFO_NAME@%tinfo%g
s%@LIB_NAME@%ncurses%g
s%@LIB_PREFIX@%lib%g
s%@LIB_SUFFIX@%%g
s%@CC_G_OPT@%-g%g
s%@CXX_G_OPT@%-g%g
s%@LD_MODEL@%%g
s%@CC_SHARED_OPTS@%unknown%g
s%@LD_SHARED_OPTS@%%g
s%@MK_SHARED_LIB@%echo unknown%g
s%@LINK_PROGS@%%g
s%@LINK_TESTS@%%g
s%@EXTRA_LDFLAGS@%%g
s%@LOCAL_LDFLAGS@%%g
s%@LOCAL_LDFLAGS2@%%g
s%@INSTALL_LIB@%-m 644%g
s%@TERMINFO_SRC@%${top_srcdir}/misc/terminfo.src%g
s%@FALLBACK_LIST@%ansi%g
s%@TERMINFO_DIRS@%%g
s%@TERMINFO@%${prefix}/share/terminfo%g
s%@NCURSES_CONST@%/*nothing*/%g
s%@NCURSES_XNAMES@%0%g
s%@ECHO_LINK@%%g
s%@EXTRA_CFLAGS@%%g
s%@MATH_LIB@%%g
s%@cf_cv_typeof_chtype@%long%g
s%@cf_cv_1UL@%1UL%g
s%@cf_cv_shift_limit@%64%g
s%@cf_cv_widec_shift@%8%g
s%@CXXCPP@%c++ -E%g
s%@CXXLDFLAGS@%%g
s%@CXXLIBS@%%g
s%@gnat_exists@%%g
s%@M4_exists@%%g
s%@cf_ada_make@%%g
s%@cf_ada_compiler@%%g
s%@cf_ada_package@%%g
s%@ADAFLAGS@%%g
s%@cf_compile_generics@%%g
s%@cf_generic_objects@%%g
s%@ADA_INCLUDE@%%g
s%@ADA_OBJECTS@%%g
s%@ACPPFLAGS@% -I. -I../../include -I$(includedir)%g
s%@DFT_ARG_SUFFIX@%%g
s%@DFT_DEP_SUFFIX@%.a%g
s%@DFT_OBJ_SUBDIR@%objects%g
s%@CXX_LIB_SUFFIX@%.a%g
s%@EXTRA_LIBS@%%g
s%@TINFO_LIST@%%g
s%@SHLIB_LIST@%%g
s%@TEST_DEPS@%../lib/libform.a ../lib/libmenu.a ../lib/libpanel.a ../lib/libncurses.a %g
s%@TEST_ARGS@%-L../lib -L$(libdir) -lform -lmenu -lpanel -lncurses %g
s%@PROG_ARGS@%-L../lib -L$(libdir) -lncurses %g
s%@ADA_SUBDIRS@%%g
s%@DIRS_TO_MAKE@%lib objects%g

CEOF

# Split the substitutions into bite-sized pieces for seds with
# small command number limits, like on Digital OSF/1 and HP-UX.
ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
ac_file=1 # Number of current file.
ac_beg=1 # First line for current file.
ac_end=$ac_max_sed_cmds # Line after last line for current file.
ac_more_lines=:
ac_sed_cmds=""
while $ac_more_lines; do
  if test $ac_beg -gt 1; then
    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
  else
    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
  fi
  if test ! -s conftest.s$ac_file; then
    ac_more_lines=false
    rm -f conftest.s$ac_file
  else
    if test -z "$ac_sed_cmds"; then
      ac_sed_cmds="sed -f conftest.s$ac_file"
    else
      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
    fi
    ac_file=`expr $ac_file + 1`
    ac_beg=$ac_end
    ac_end=`expr $ac_end + $ac_max_sed_cmds`
  fi
done
if test -z "$ac_sed_cmds"; then
  ac_sed_cmds=cat
fi

CONFIG_FILES=${CONFIG_FILES-"	include/MKterm.h.awk 	include/curses.h 	include/termcap.h 	include/unctrl.h 	misc/run_tic.sh:misc/run_tic.in 	 man/Makefile include/Makefile ncurses/Makefile panel/Makefile menu/Makefile form/Makefile misc/Makefile test/Makefile 	Makefile"}
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  case "$ac_file" in
  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  *) ac_file_in="${ac_file}.in" ;;
  esac

  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.

  # Remove last slash and all that follows it.  Not all systems have dirname.
  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
    # The file is in a subdirectory.
    test ! -d "$ac_dir" && mkdir "$ac_dir"
    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
    # A "../" for each directory in $ac_dir_suffix.
    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
  else
    ac_dir_suffix= ac_dots=
  fi

  case "$ac_given_srcdir" in
  .)  srcdir=.
      if test -z "$ac_dots"; then top_srcdir=.
      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
  *) # Relative path.
    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
    top_srcdir="$ac_dots$ac_given_srcdir" ;;
  esac

  case "$ac_given_INSTALL" in
  [/$]*) INSTALL="$ac_given_INSTALL" ;;
  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
  esac

  echo creating "$ac_file"
  rm -f "$ac_file"
  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
  case "$ac_file" in
  *Makefile*) ac_comsub="1i\\
# $configure_input" ;;
  *) ac_comsub= ;;
  esac

  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
  sed -e "$ac_comsub
s%@configure_input@%$configure_input%g
s%@srcdir@%$srcdir%g
s%@top_srcdir@%$top_srcdir%g
s%@INSTALL@%$INSTALL%g
" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
fi; done
rm -f conftest.s*

# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
# NAME is the cpp macro being defined and VALUE is the value it is being given.
#
# ac_d sets the value in "#define NAME VALUE" lines.
ac_dA='s%^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
ac_dB='\([ 	][ 	]*\)[^ 	]*%\1#\2'
ac_dC='\3'
ac_dD='%g'
# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
ac_uA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
ac_uB='\([ 	]\)%\1#\2define\3'
ac_uC=' '
ac_uD='\4%g'
# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
ac_eA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
ac_eB='$%\1#\2define\3'
ac_eC=' '
ac_eD='%g'

if test "${CONFIG_HEADERS+set}" != set; then
  CONFIG_HEADERS="include/ncurses_cfg.h:include/ncurses_cfg.hin"
fi
for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  case "$ac_file" in
  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  *) ac_file_in="${ac_file}.in" ;;
  esac

  echo creating $ac_file

  rm -f conftest.frag conftest.in conftest.out
  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
  cat $ac_file_inputs > conftest.in

  rm -f conftest.frag
  cat >> conftest.frag <<CEOF

#define CC_HAS_INLINE_FUNCS 1
#define CC_HAS_PROTOS 1
#define ETIP_NEEDS_MATH_H 1
#define GCC_NORETURN __attribute__((noreturn))
#define GCC_PRINTF 1
#define GCC_SCANF 1
#define GCC_UNUSED __attribute__((unused))
#define HAVE_DIRENT_H 1
#define HAVE_ERRNO 1
#define HAVE_FCNTL_H 1
#define HAVE_FORM_H 1
CEOF
  cat >> conftest.frag <<CEOF
#define HAVE_GETCWD 1
#define HAVE_GETEGID 1
#define HAVE_GETEUID 1
#define HAVE_GETOPT_H 1
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GETTTYNAM 1
#define HAVE_ISASCII 1
#define HAVE_ISSETUGID 1
#define HAVE_LIBC_H 1
#define HAVE_LIBFORM 1
#define HAVE_LIBMENU 1
#define HAVE_LIBPANEL 1
CEOF
  cat >> conftest.frag <<CEOF
#define HAVE_LIMITS_H 1
#define HAVE_LINK 1
#define HAVE_LOCALE_H 1
#define HAVE_LONG_FILE_NAMES 1
#define HAVE_MEMCCPY 1
#define HAVE_MENU_H 1
#define HAVE_MKSTEMP 1
#define HAVE_NANOSLEEP 1
#define HAVE_NC_ALLOC_H 1
#define HAVE_PANEL_H 1
#define HAVE_POLL 1
#define HAVE_POLL_H 1
CEOF
  cat >> conftest.frag <<CEOF
#define HAVE_REGEX_H_FUNCS 1
#define HAVE_REMOVE 1
#define HAVE_REMOVE 1
#define HAVE_SELECT 1
#define HAVE_SETBUF 1
#define HAVE_SETBUFFER 1
#define HAVE_SETVBUF 1
#define HAVE_SIGACTION 1
#define HAVE_SIGVEC 1
#define HAVE_SIZECHANGE 1
#define HAVE_STRDUP 1
#define HAVE_STRSTR 1
CEOF
  cat >> conftest.frag <<CEOF
#define HAVE_SYMLINK 1
#define HAVE_SYS_IOCTL_H 1
#define HAVE_SYS_PARAM_H 1
#define HAVE_SYS_POLL_H 1
#define HAVE_SYS_SELECT_H 1
#define HAVE_SYS_TIMES_H 1
#define HAVE_SYS_TIME_H 1
#define HAVE_SYS_TIME_SELECT 1
#define HAVE_TCGETATTR 1
#define HAVE_TCGETPGRP 1
#define HAVE_TERMIOS_H 1
#define HAVE_TIMES 1
CEOF
  cat >> conftest.frag <<CEOF
#define HAVE_TTYENT_H 1
#define HAVE_TYPEINFO 1
#define HAVE_UNISTD_H 1
#define HAVE_UNISTD_H 1
#define HAVE_UNLINK 1
#define HAVE_VFSCANF 1
#define HAVE_VSNPRINTF 1
#define HAVE_VSSCANF 1
#define HAVE_WORKING_POLL 1
#define NDEBUG 1
#define PURE_TERMINFO 1
#define RETSIGTYPE void
CEOF
  cat >> conftest.frag <<CEOF
#define STDC_HEADERS 1
#define SYSTEM_NAME "darwin18.7.0"
#define TYPEOF_CHTYPE long
#define USE_ASSUMED_COLOR 1
#define USE_HASHMAP 1
#define USE_ROOT_ENVIRON 1
CEOF
  cat >> conftest.edit <<CEOF
/@DEFS@/r conftest.frag
/@DEFS@/d
CEOF
sed -f conftest.edit conftest.in > conftest.out
rm -f conftest.in
mv conftest.out conftest.in
rm -f conftest.edit conftest.frag

  rm -f conftest.frag conftest.h
  echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
  cat conftest.in >> conftest.h
  rm -f conftest.in
  if cmp -s $ac_file conftest.h 2>/dev/null; then
    echo "$ac_file is unchanged"
    rm -f conftest.h
  else
    # Remove last slash and all that follows it.  Not all systems have dirname.
      ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
      if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
      # The file is in a subdirectory.
      test ! -d "$ac_dir" && mkdir "$ac_dir"
    fi
    rm -f $ac_file
    mv conftest.h $ac_file
  fi
fi; done

# Extra initialization commands, if any

### Special initialization commands, used to pass information from the
### configuration-run into config.status

AWK="awk"
CF_LIST_MODELS=" normal"
DFT_LWR_MODEL="normal"
LDCONFIG=""
LIB_NAME="ncurses"
LIB_SUFFIX=""
LIB_SUBSETS="termlib+base"
LIB_TRACING="DEBUG"
SRC_SUBDIRS="man include ncurses panel menu form misc test"
TERMINFO="${prefix}/share/terminfo"
TINFO_NAME="tinfo"
WITH_ECHO="yes"
WITH_OVERWRITE="yes"
WITH_CURSES_H="no"
cf_cv_abi_version="5"
cf_cv_do_symlinks="no"
cf_cv_rel_version="5.2"
cf_cv_rm_so_locs="no"
cf_cv_system_name="darwin18.7.0"
cf_with_cxx_binding="no"
cf_cv_shlib_version="auto"
target="i386-apple-darwin18.7.0"


# Extra commands, if any



	case $cf_cv_system_name in
	os2)	LIB_PREFIX=''     ;;
	*)	LIB_PREFIX='lib'  ;;
	esac
cf_prefix=$LIB_PREFIX
	


for cf_dir in $SRC_SUBDIRS
do
	if test -f $srcdir/$cf_dir/modules; then

		cf_libs_to_make=
		for cf_item in $CF_LIST_MODELS
		do
			
	
	case $cf_item in
	libtool) cf_suffix='.la'  ;;
	normal)  cf_suffix='.a'   ;;
	debug)   cf_suffix='_g.a' ;;
	profile) cf_suffix='_p.a' ;;
	shared)
		case $cf_cv_system_name in
		hpux*)	cf_suffix='.sl'  ;;
		*)	cf_suffix='.so'  ;;
		esac
	esac
	test -n "$LIB_SUFFIX" && cf_suffix="${LIB_SUFFIX}${cf_suffix}"

			if test $cf_item = shared ; then
			if test "$cf_cv_do_symlinks" = yes ; then
				case "$cf_cv_shlib_version" in #(vi
				rel) cf_suffix="$cf_suffix"'.$(REL_VERSION)' ;; #(vi
				abi) cf_suffix="$cf_suffix"'.$(ABI_VERSION)' ;;
				esac
			fi
			fi
			cf_libs_to_make="$cf_libs_to_make ../lib/${cf_prefix}${cf_dir}${cf_suffix}"
		done

		if test $cf_dir = ncurses ; then
			case "$LIB_SUBSETS" in #(vi
			termlib+*) #(vi
				;;
			*) #(vi
				cf_item=`echo $cf_libs_to_make |sed -e s/$LIB_NAME/$TINFO_NAME/g`
				cf_libs_to_make="$cf_item $cf_libs_to_make"
				;;
			esac
		fi

		sed -e "s@\@LIBS_TO_MAKE\@@$cf_libs_to_make@" \
			$cf_dir/Makefile >$cf_dir/Makefile.out
		mv $cf_dir/Makefile.out $cf_dir/Makefile

		$AWK -f $srcdir/mk-0th.awk \
			name=$cf_dir \
			$srcdir/$cf_dir/modules >>$cf_dir/Makefile

		for cf_item in $CF_LIST_MODELS
		do
			echo 'Appending rules for '$cf_item' model ('$cf_dir')'
			
CF_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`

			
	
	case $cf_item in
	libtool) cf_suffix='.la'  ;;
	normal)  cf_suffix='.a'   ;;
	debug)   cf_suffix='_g.a' ;;
	profile) cf_suffix='_p.a' ;;
	shared)
		case $cf_cv_system_name in
		hpux*)	cf_suffix='.sl'  ;;
		*)	cf_suffix='.so'  ;;
		esac
	esac
	test -n "$LIB_SUFFIX" && cf_suffix="${LIB_SUFFIX}${cf_suffix}"

			
	case $cf_item in
	libtool) cf_subdir='obj_lo'  ;;
	normal)  cf_subdir='objects' ;;
	debug)   cf_subdir='obj_g' ;;
	profile) cf_subdir='obj_p' ;;
	shared)  cf_subdir='obj_s' ;;
	esac


			# These dependencies really are for development, not
			# builds, but they are useful in porting, too.
			cf_depend="../include/ncurses_cfg.h"
			if test "$srcdir" = "."; then
				cf_reldir="."
			else
				cf_reldir="\$(srcdir)"
			fi

			if test -f $srcdir/$cf_dir/$cf_dir.priv.h; then
				cf_depend="$cf_depend $cf_reldir/$cf_dir.priv.h"
			elif test -f $srcdir/$cf_dir/curses.priv.h; then
				cf_depend="$cf_depend $cf_reldir/curses.priv.h"
			fi

			for cf_subset in $LIB_SUBSETS
			do
			$AWK -f $srcdir/mk-1st.awk \
				name=$cf_dir \
				traces=$LIB_TRACING \
				MODEL=$CF_ITEM \
				model=$cf_subdir \
				prefix=$cf_prefix \
				suffix=$cf_suffix \
				subset=$cf_subset \
				ShlibVer=$cf_cv_shlib_version \
				DoLinks=$cf_cv_do_symlinks \
				rmSoLocs=$cf_cv_rm_so_locs \
				ldconfig="$LDCONFIG" \
				overwrite=$WITH_OVERWRITE \
				depend="$cf_depend" \
				target="$target" \
				$srcdir/$cf_dir/modules >>$cf_dir/Makefile
			test $cf_dir = ncurses && WITH_OVERWRITE=no
			$AWK -f $srcdir/mk-2nd.awk \
				name=$cf_dir \
				traces=$LIB_TRACING \
				MODEL=$CF_ITEM \
				model=$cf_subdir \
				subset=$cf_subset \
				srcdir=$srcdir \
				echo=$WITH_ECHO \
				$srcdir/$cf_dir/modules >>$cf_dir/Makefile
			done
		done
	fi

	echo '	cd '$cf_dir' && $(MAKE) $(CF_MFLAGS) $@' >>Makefile
done

for cf_dir in $SRC_SUBDIRS
do
	if test -f $cf_dir/Makefile ; then
		case "$cf_dir" in
		Ada95) #(vi
			echo 'libs \' >> Makefile
			echo 'install.libs \' >> Makefile
			echo 'uninstall.libs ::' >> Makefile
			echo '	cd '$cf_dir' && $(MAKE) $(CF_MFLAGS) $@' >> Makefile
			;;
		esac
	fi

	if test -f $srcdir/$cf_dir/modules; then
		echo >> Makefile
		if test -f $srcdir/$cf_dir/headers; then
cat >> Makefile <<CF_EOF
install.includes \\
uninstall.includes \\
CF_EOF
		fi
if test "$cf_dir" != "c++" ; then
echo 'lint \' >> Makefile
fi
cat >> Makefile <<CF_EOF
libs \\
lintlib \\
install.libs \\
uninstall.libs \\
install.$cf_dir \\
uninstall.$cf_dir ::
	cd $cf_dir && \$(MAKE) \$(CF_MFLAGS) \$@
CF_EOF
	elif test -f $srcdir/$cf_dir/headers; then
cat >> Makefile <<CF_EOF

libs \\
install.libs \\
uninstall.libs \\
install.includes \\
uninstall.includes ::
	cd $cf_dir && \$(MAKE) \$(CF_MFLAGS) \$@
CF_EOF
fi
done

cat >> Makefile <<CF_EOF

install.data \
uninstall.data ::
	cd misc && \$(MAKE) \$(CF_MFLAGS) \$@

install.man \
uninstall.man ::
	cd man && \$(MAKE) \$(CF_MFLAGS) \$@

distclean ::
	rm -f config.cache config.log config.status Makefile include/ncurses_cfg.h
	rm -f headers.sh headers.sed
	rm -rf \$(DIRS_TO_MAKE)
CF_EOF

# Special case: tack's manpage lives in its own directory.
if test -d tack ; then
if test -f $srcdir/$tack.h; then
cat >> Makefile <<CF_EOF

install.man \
uninstall.man ::
	cd tack && \$(MAKE) \$(CF_MFLAGS) \$@
CF_EOF
fi
fi


rm -f headers.sed headers.sh

echo creating headers.sh
cat >headers.sh <<CF_EOF
#! /bin/sh
# This shell script is generated by the 'configure' script.  It is invoked in a
# subdirectory of the build tree.  It generates a sed-script in the parent
# directory that is used to adjust includes for header files that reside in a
# subdirectory of /usr/include, etc.
PRG=""
while test \$# != 3
do
PRG="\$PRG \$1"; shift
done
DST=\$1
REF=\$2
SRC=\$3
TMPSRC=\${TMPDIR-/tmp}/\`basename \$SRC\`\$\$
TMPSED=\${TMPDIR-/tmp}/headers.sed\$\$
echo installing \$SRC in \$DST
CF_EOF
if test $WITH_CURSES_H = yes; then
	cat >>headers.sh <<CF_EOF
case \$DST in
/*/include/*)
	END=\`basename \$DST\`
	for i in \`cat \$REF/../*/headers |fgrep -v "#"\`
	do
		NAME=\`basename \$i\`
		echo "s/<\$NAME>/<\$END\/\$NAME>/" >> \$TMPSED
	done
	;;
*)
	echo "" >> \$TMPSED
	;;
esac
CF_EOF
else
	cat >>headers.sh <<CF_EOF
case \$DST in
/*/include/*)
	END=\`basename \$DST\`
	for i in \`cat \$REF/../*/headers |fgrep -v "#"\`
	do
		NAME=\`basename \$i\`
		if test "\$NAME" = "curses.h"
		then
			echo "s/<curses.h>/<ncurses.h>/" >> \$TMPSED
			NAME=ncurses.h
		fi
		echo "s/<\$NAME>/<\$END\/\$NAME>/" >> \$TMPSED
	done
	;;
*)
	echo "s/<curses.h>/<ncurses.h>/" >> \$TMPSED
	;;
esac
CF_EOF
fi
cat >>headers.sh <<CF_EOF
rm -f \$TMPSRC
sed -f \$TMPSED \$SRC > \$TMPSRC
NAME=\`basename \$SRC\`
CF_EOF
if test $WITH_CURSES_H != yes; then
	cat >>headers.sh <<CF_EOF
test "\$NAME" = "curses.h" && NAME=ncurses.h
CF_EOF
fi
cat >>headers.sh <<CF_EOF
eval \$PRG \$TMPSRC \$DST/\$NAME
rm -f \$TMPSRC \$TMPSED
CF_EOF

chmod 0755 headers.sh

for cf_dir in $SRC_SUBDIRS
do
	if test -f $srcdir/$cf_dir/headers; then
	cat >>$cf_dir/Makefile <<CF_EOF
\$(DESTDIR)\$(includedir) :
	\$(srcdir)/../mkinstalldirs \$@

install \\
install.libs \\
install.includes :: \$(AUTO_SRC) \$(DESTDIR)\$(includedir) \\
CF_EOF
		j=""
		for i in `cat $srcdir/$cf_dir/headers |fgrep -v "#"`
		do
			test -n "$j" && echo "		$j \\" >>$cf_dir/Makefile
			j=$i
		done
		echo "		$j" >>$cf_dir/Makefile
		for i in `cat $srcdir/$cf_dir/headers |fgrep -v "#"`
		do
			echo "	@ (cd \$(DESTDIR)\$(includedir) && rm -f `basename $i`) ; ../headers.sh \$(INSTALL_DATA) \$(DESTDIR)\$(includedir) \$(srcdir) $i" >>$cf_dir/Makefile
			test $i = curses.h && test $WITH_CURSES_H = yes && echo "	@ (cd \$(DESTDIR)\$(includedir) && rm -f ncurses.h && \$(LN_S) curses.h ncurses.h)" >>$cf_dir/Makefile
		done

	cat >>$cf_dir/Makefile <<CF_EOF

uninstall \\
uninstall.libs \\
uninstall.includes ::
CF_EOF
		for i in `cat $srcdir/$cf_dir/headers |fgrep -v "#"`
		do
			i=`basename $i`
			echo "	-@ (cd \$(DESTDIR)\$(includedir) && rm -f $i)" >>$cf_dir/Makefile
			test $i = curses.h && echo "	-@ (cd \$(DESTDIR)\$(includedir) && rm -f ncurses.h)" >>$cf_dir/Makefile
		done
	fi
done



exit 0
